package com.zaofan.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zaofan.bean.AppyLog;
import com.zaofan.dao.AppyLogDao;

public class AppyLogService {
	private AppyLogDao appylogDao = new AppyLogDao();

	public void delete(AppyLog appylog) {
		appylogDao.del(appylog);
	}

	public void add(AppyLog appylog) {
		appylogDao.add(appylog);
	}

	public void update(AppyLog appylog) {
		appylogDao.update(appylog);
	}

	public List<AppyLog> findAll(Map<String, Object> params) {
		List<AppyLog> data = appylogDao.findAll(params);
		if (data == null) {
			data = new ArrayList<>();
		}
		return data;
	}

	public Long count(Map<String, Object> params) {
		return appylogDao.count(params);
	}

	public AppyLog findById(Integer id) {
		Map<String, Object> params = new HashMap<>();
		params.put("id", id);
		return appylogDao.findOne(params);
	}

	public AppyLog exit(Integer appyId, String mobile) {
		Map<String, Object> params = new HashMap<>();
		params.put("appyId", appyId);
		params.put("mobile", mobile);
		return appylogDao.findOne(params);
	}

	public List<AppyLog> findByAppyId(int appyId) {
		Map<String, Object> params = new HashMap<>();
		params.put("appyId", appyId);
		return appylogDao.findAll(params);
	}

}
